function insertToPartent(text){
    parent.document.myform.pic.value = text;
    parent.document.getElementById('img').innerHTML = '<p><a href="' + gallery_path + text + '" target="_blank"><img src="' + gallery_path + text + '" alt="" /></a></p>';
}

function previewfile(filename){
    var filname;
    document.getElementById('idPreview').innerHTML = '<a target="_blank" href="' + gallery_path + filename + '"><img alt="" src="' + gallery_path + filename + '"/></a>';
}

function mySimpleHtmlInserter(textAreaId, files){
    var insertHtml = '<img src="' + gallery_path + files + '" alt="manhkhanh" />';
    parent.tinyMCE.getInstanceById(textAreaId).getWin().focus();
    parent.tinyMCE.execCommand('mceInsertContent', false, insertHtml);
}

function change_url(url_link){
    u = admin_path + url_link;
    window.location.href = u;
}

function submit_url( url_text ){
	var cat_id = document.getElementById('cat').value;
    change_url(url_text + cat_id);
}
